package cn.stylefeng.guns.aspect;

import org.springframework.util.StringUtils;

/**
 * 简化日志
 */
public abstract  class SimplifyResponseLog {

    private static   final int SUBSTR_SIZE=10000;


    /**
     * 减少ResponseLog,替换[里的内容]
     * @Param log 将被打印的log
     * @return
     */
    public static Object reduceLog(String log) {
        if (!StringUtils.isEmpty(log)) {
            return log;
        }
        if (log.length() > SUBSTR_SIZE) {
            return log.substring(0, SUBSTR_SIZE)+"....reduced......";
        }

        return  log;
    }



}
